<%@include file="startUpIncludes.jsp" %>
   <%--<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> --%> 
  <%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
        <title>Leads</title>
        <script type="text/javascript" src="../js/leads_table.js"></script>
	<script type="text/javascript">
            $(document).ready(function() {
                var userDetails = "${userDetails.id}";
            	var userRoles="${userRoles}";
            	leadTable(userRoles,userDetails);
                $('#wrapper').dialog({
                    autoOpen: false,
                    title: 'Import Calls'
                    ,height: 140,
                    width:452,
                     modal: true 
                });
                $('#opener').click(function() {
                    $('#wrapper').dialog('open');
//                  return false;
                });
                
                $('#leadwrapper').dialog({
                    autoOpen: false,
                    title: 'Import Leads'
                    ,height: 140,
                    width:452,
                     modal: true 
                });
                
                $('#leadopener').click(function() {
                    $('#leadwrapper').dialog('open');
//                  return false;
                });
                $('#appointmentwrapper').dialog({
                    autoOpen: false,
                    title: 'Import Appointments'
                    ,height: 140,
                    width:452,
                     modal: true 
                });
                
                $('#appointmentopener').click(function() {
                    $('#appointmentwrapper').dialog('open');
//                  return false;
                });
            });
 	</script>
    </head>
    <body class="leadsPage">
    <jsp:include page="header.jsp" >
		<jsp:param value="true" name="loggedIn"/>
	</jsp:include>
    <div class="wrap">
        <div class="main">
		<%@include file="basicLeftMenu.jsp" %>
            <div class="content">
				<jsp:include page="tabs.jsp" >
					<jsp:param value="leads" name="currentPage"/>
				</jsp:include>
                <div class="tab-content">
                <h3>Leads</h3>

                <div class="content-block">
                    <h4>Recent Leads</h4>
                    
                    <div class="action-btns">
                    <a href="deleteLeads" class="form-btn">Delete Leads</a>
                    		<shiro:hasRole name="leadAdd">
                    		<a href="newLead" class="form-btn">New Lead</a>
                    		</shiro:hasRole>
							<shiro:hasRole name="leadImport">
							<button id="leadopener" class="form-btn">Import Leads</button>
                    		</shiro:hasRole>  
							<div id="leadwrapper">
							<form action="/sales/s/importLeads" method="post" enctype="multipart/form-data"> 
			                    <label>Choose leads file to upload:</label> 
			                    <input type="file"  id="fileInput" name="fileInput" id="fileInput"/>
			                    <input type="submit" value="Upload" class="form-btn" />
                    		</form>
                    </div>
                    </div>
                <div class='table-container'>
					    <table class='display jqueryDataTable'>
					   <thead>
					    <tr>
					       <th>Actions</th>
					     <th>  </th>
					     <th>Lead Name</th>
					     <th>Lead Status</th>
					     <th>Lead Company</th>
					     <th>Lead Owner</th>
					    </tr>
					   </thead>
					   <tbody>
					   </tbody>
					   </table>
				</div>
                </div>
            </div>
        </div>
        
    <%@include file="footer.jspf" %>
    </div>
    </div>

    </body>
</html>